import pymysql.cursors

conn= pymysql.connect(
        host='localhost',
        port = 3306,
        user='root',
        passwd='root',
        db ='gongxiang',
        )
cur.close()
conn.commit()
conn.close()
cur = conn.cursor()